home *** CD-ROM | disk | FTP | other *** search
- --- orig/src/PatchLev.h Tue Jan 4 15:31:56 2000
- +++ ./src/PatchLev.h Sun Jul 11 11:08:30 1999
- @@ -3,4 +3,4 @@
- * directory.
- */
-
- -#define PatchLevel "49"
- +#define PatchLevel "49cf"
-
- diff -ur orig/src/clock.c ./src/clock.c
- --- orig/src/clock.c Fri May 29 18:57:24 1998
- +++ ./src/clock.c Sun Aug 1 12:13:20 1999
- @@ -2,37 +2,15 @@
- per second (under TOS, 200 per second) */
- /* written by ERS */
-
- +#include <sysvars.h>
- #include <time.h>
- -#include <osbind.h>
- -#include <mintbind.h>
- -#include <ssystem.h>
-
- extern clock_t _starttime; /* in main.c */
-
- -static clock_t now;
- -
- -/* this must execute in supervisor mode; it fetches the system variable
- - * containing the number of 200HZ ticks since the system was booted
- - */
- -
- -static long getnow __PROTO((void));
- -
- -static long
- -getnow()
- -{
- - now = *((unsigned long *) 0x4baL);
- - return 0;
- -}
- -
- clock_t
- _clock()
- {
- - if (Ssystem(-1, NULL, NULL)) {
- - (void)Supexec(getnow);
- - return (now - _starttime);
- - }
- - else
- - return (Ssystem(GET_LVAL, 0x000004baL, NULL) - _starttime);
- + return (get_sysvar(_hz_200) - _starttime);
- }
-
- /* This next bit of nonsense is temporary...clock() should be fixed! */
-
- diff -ur orig/src/crtinit.c ./src/crtinit.c
- --- orig/src/crtinit.c Fri May 29 18:57:26 1998
- +++ ./src/crtinit.c Sun Aug 1 12:38:00 1999
- @@ -83,6 +83,7 @@
- #include <basepage.h>
- #include <osbind.h>
- #include <support.h>
- +#include <sys/cookie.h>
- #include "lib.h"
-
- #define isspace(c) ((c) == ' '||(c) == '\t')
- @@ -410,16 +411,74 @@
- while(i > 0 && isspace(*cmdln) )
- cmdln++,--i;
-
- - while (i > 0) {
- - if (isspace(*cmdln)) {
- - --i; cmdln++;
- - while (i > 0 && isspace(*cmdln))
- - --i,cmdln++;
- - *to++ = 0;
- + /*
- + * MagXDesk only uses ARGV if the arg is longer than the 126 character
- + * of bp->cmdlin. If the arg is short enough and contains a file name with
- + * blanks it will be come quoted via bp->cmdlin!!
- + */
- + if (Getcookie(C_MagX, NULL) == C_FOUND && cmdln[0] != '\'')
- + {
- + while (i > 0) {
- + if (isspace(*cmdln)) {
- + --i; cmdln++;
- + while (i > 0 && isspace(*cmdln))
- + --i,cmdln++;
- + *to++ = 0;
- + }
- + else {
- + if ((*to++ = *cmdln++) == 0) break;
- + --i;
- + }
- }
- - else {
- - if ((*to++ = *cmdln++) == 0) break;
- - --i;
- + }
- + else
- + {
- + int in_quote = 0;
- +
- + while (i > 0)
- + {
- + if (*cmdln == '\'')
- + {
- + i--;
- + cmdln++;
- + if (in_quote)
- + {
- + if (*cmdln == '\'') /* double ': file name contains ' */
- + {
- + *to++ = *cmdln++;
- + i--;
- + }
- + else
- + {
- + in_quote = 0;
- + *to++ = 0; /* end of quoted arg */
- + i--; cmdln++;
- + }
- + }
- + else
- + in_quote = 1;
- + }
- + else
- + {
- + if (*cmdln == ' ')
- + {
- + if (in_quote)
- + {
- + *to++ = *cmdln++;
- + i--;
- + }
- + else
- + {
- + --i; cmdln++;
- + *to++ = 0;
- + }
- + }
- + else
- + {
- + *to++ = *cmdln++;
- + i--;
- + }
- + }
- }
- }
- *to++ = '\0';
- --- orig/src/getcooki.c Sun Oct 25 13:06:48 1998
- +++ src/getcooki.c Tue Sep 28 17:14:36 1999
- @@ -9,30 +9,31 @@
- * returns:
- *
- * - E_OK if cookie was found
- - * - negative error number if cookie is missing
- + * - EERROR if cookie is missing
- *
- * if p_value is set, cookie value is copied to *p_value
- *
- */
-
- -# include <osbind.h>
- # include <mintbind.h>
- -# include <ssystem.h>
- +# include <mint/ssystem.h>
- # include <errno.h>
- -static long
- -getcookieptr (void)
- +# include <sysvars.h>
- +
- +extern int __has_no_ssystem;
- +
- +static long getcookieptr (void)
- {
- return *((long *) 0x5a0);
- }
-
- -int
- -Getcookie (long cookie, long *p_value)
- +int Getcookie(long cookie, long *p_value)
- {
- - if (Ssystem (-1, 0, 0)) /* better a global _has_ssystem? */
- + if (__has_no_ssystem)
- {
- /* old method */
- -
- - long *cookieptr = (long *) Supexec (getcookieptr);
- +/* long *cookieptr = (long *) get_sysvar(_p_cookies);*/
- + long *cookieptr = (long *) Supexec(getcookieptr);
-
- if (cookieptr)
- {
- @@ -49,12 +50,40 @@
- cookieptr += 2;
- }
- }
- -
- + if (p_value)
- + *p_value = 0;
- +
- return EERROR;
- }
- -
- - /* Ssystem supported, use it */
- -
- - return Ssystem (GETCOOKIE, cookie, p_value);
- -}
- + else
- + {
- + /* Ssystem supported, use it */
- + int r;
- + long v = -42;
-
- + if (p_value)
- + *p_value = 0;
- +
- + r = Ssystem(S_GETCOOKIE, cookie, &v);
- +
- + /*
- + * Backward compatibility for MiNT 1.14.7:
- + * Ssystems() returns cookie value and ignores arg2!!
- + */
- + if (r != -1 && v == -42)
- + v = r;
- +
- + if (r == -1) /* not found */
- + {
- + v = 0;
- + r = EERROR;
- + }
- + else
- + r = E_OK;
- +
- + if (p_value)
- + *p_value = v;
- +
- + return r;
- + }
- +}
- diff -ur orig/src/ioctl.c ./src/ioctl.c
- --- orig/src/ioctl.c Fri May 29 18:57:58 1998
- +++ ./src/ioctl.c Sun Aug 1 12:27:50 1999
- @@ -11,11 +11,12 @@
- #include <linea.h> /* for TIOCGWINSZ under TOS */
- #include <support.h>
- #include <stat.h>
- -#include <ssystem.h>
- +#include <mint/ssystem.h>
- #include <types.h>
- #include "lib.h" /* for __open_stat */
-
- extern int __mint; /* MiNT version */
- +extern int __has_no_ssystem;
- int _ttydisc = NTTYDISC;
- int _ldisc = LLITOUT;
-
- @@ -160,12 +161,12 @@
- *msig |= ((g & (1 << 3)) ? 0 : TIOCM_RTS);
- *msig |= ((g & (1 << 4)) ? 0 : TIOCM_DTR);
- mfp = ((short *) 0xfffffa00L);
- - if (Ssystem(-1,NULL,NULL)) {
- + if (__has_no_ssystem) {
- ssp = Super(0L);
- m = *mfp & 0xff;
- Super(ssp);
- } else
- - m = (short)(Ssystem(TIOCMGET, (u_long)mfp, NULL));
- + m = (short)(Ssystem(S_TIOCMGET, (u_long)mfp, NULL));
- *msig |= ((m & (1 << 1)) ? 0 : TIOCM_CAR);
- *msig |= ((m & (1 << 2)) ? 0 : TIOCM_CTS);
- *msig |= ((m & (1 << 6)) ? 0 : TIOCM_RNG);
- diff -ur orig/src/localtim.c ./src/localtim.c
- --- orig/src/localtim.c Wed Oct 14 16:37:38 1998
- +++ ./src/localtim.c Sun Aug 1 11:59:22 1999
- @@ -2,9 +2,6 @@
- ** This file is in the public domain, so clarified as of
- ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
- */
- -#include "PatchLev.h"
- -static char PATCHid[] = "$Patchlevel: MiNT library, localtim.c " PatchLevel " $";
- -
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)localtime.c 7.61";
- diff -ur orig/src/main.c ./src/main.c
- --- orig/src/main.c Fri May 29 18:58:16 1998
- +++ ./src/main.c Sun Aug 1 12:18:16 1999
- @@ -13,7 +13,9 @@
- #include <unistd.h>
- #include <ctype.h>
- #include <param.h>
- -#include <ssystem.h>
- +#include <sysvars.h>
- +#include <mint/ssystem.h>
- +#include <sys/cookie.h>
- #include "lib.h"
-
- int errno;
- @@ -30,51 +32,7 @@
- typedef void (*ExitFn) __PROTO((void));
- ExitFn *_at_exit;
- int _num_at_exit; /* number of functions registered - 1 */
- -static int no_ssystem;
- -
- -/*
- - * get MiNT version number. Since this has to be done in supervisor mode,
- - * we might as well set the start-up time of the system here, too.
- - */
- -/* this function is called in user mode if the kernel supports Ssystem() */
- -static long getMiNT __PROTO((void));
- -
- -static long
- -getMiNT()
- -{
- - long *cookie;
- -
- -/* get the system time in 200HZ ticks from the BIOS _hz_200 variable */
- - if (no_ssystem)
- - _starttime = *((unsigned long *) 0x4baL);
- - else
- - _starttime = Ssystem(GET_LVAL, 0x000004baL, NULL);
- -
- - _childtime = 0;
- -
- - if (no_ssystem) {
- - cookie = *((long **) 0x5a0L);
- - if (!cookie)
- - __mint = 0;
- - else {
- - while (*cookie) {
- - if (*cookie == 0x4d694e54L) { /* MiNT */
- - __mint = (int) cookie[1];
- - return 0;
- - }
- - cookie += 2;
- - }
- -
- - }
- -
- - }
- - else {
- - __mint = (int)Ssystem(GETCOOKIE, 0x4d694e54L, NULL);
- - return 0;
- - }
- - __mint = 0;
- - return 0;
- -}
- +int __has_no_ssystem;
-
- /* supplied by the user */
- __EXTERN int main __PROTO((int, char **, char **));
- @@ -102,6 +60,7 @@
- register FILE *f;
- register int i;
- char *s, *pconv;
- + long l;
- extern int __default_mode__; /* in defmode.c or defined by user */
- extern short _app; /* tells if we're an application or acc */
-
- @@ -115,14 +74,17 @@
- _fpuinit();
- #endif
-
- + __has_no_ssystem = (int)Ssystem(-1, NULL, NULL);
- + _starttime = get_sysvar(_hz_200);
- + _childtime = 0;
- +
- /*
- * check for MiNT
- */
- - no_ssystem = Ssystem(-1, NULL, NULL);
- - if (no_ssystem)
- - (void)Supexec(getMiNT);
- + if (Getcookie(C_MiNT, &l) == C_FOUND)
- + __mint = (int) l;
- else
- - (void)getMiNT();
- + __mint = 0;
-
- if (_app)
- _pdomain = Pdomain(1); /* set MiNT domain */
- diff -ur orig/src/opendir.c ./src/opendir.c
- --- orig/src/opendir.c Fri May 29 18:58:24 1998
- +++ ./src/opendir.c Sun Aug 1 12:04:00 1999
- @@ -64,7 +64,7 @@
-
- /* test if the file system is case sensitive */
- r = Dpathconf(name, 6);
- - if (r > 0)
- + if (r == 1 || r == -EINVAL)
- d->status = _NO_CASE;
- else
- d->status = 0;
- diff -ur orig/src/spawn.c ./src/spawn.c
- --- orig/src/spawn.c Fri May 29 18:59:06 1998
- +++ ./src/spawn.c Sun Aug 1 12:10:28 1999
- @@ -468,7 +468,7 @@
- /* MiNT supports overlays with Pexec(200,...) */
-
- if (mode == P_NOWAIT) cmlen = 100;
- - else if (mode == P_OVERLAY && __mint) cmlen = 200;
- + else if (mode == P_OVERLAY) cmlen = 200;
- else cmlen = 0;
-
- rval = Pexec((int)cmlen, path, cmd, env);
- diff -ur orig/src/statfs.c ./src/statfs.c
- --- orig/src/statfs.c Sun Oct 18 05:55:34 1998
- +++ ./src/statfs.c Sun Aug 1 12:05:06 1999
- @@ -17,7 +17,7 @@
- #include <sys/statfs.h>
-
- /* from kernel source! */
- -#include <dcntl.h>
- +#include <mint/dcntl.h>
-
- extern int __mint;
-
- @@ -118,12 +118,12 @@
- }
- else
- {
- - if (Dcntl(MX_KER_XFSNAME, path, xname) >= 0) /* MagiC: only one name available */
- + if (Dcntl(MX_KER_XFSNAME, path, (long)xname) >= 0) /* MagiC: only one name available */
- strcpy(tname, xname);
- else
- {
- - strcpy(xfs_name, "tos-fs");
- - strcpy(type_name, "tos");
- + strcpy(xname, "tos-fs");
- + strcpy(tname, "tos");
- }
- }
-
- diff -ur orig/src/sysvar.c ./src/sysvar.c
- --- orig/src/sysvar.c Fri May 29 18:59:46 1998
- +++ ./src/sysvar.c Sun Aug 1 12:28:12 1999
- @@ -1,7 +1,9 @@
- #include <support.h>
- #include <osbind.h>
- #include <mintbind.h>
- -#include <ssystem.h>
- +#include <mint/ssystem.h>
- +
- +extern int __has_no_ssystem;
-
- long
- get_sysvar(var)
- @@ -10,7 +12,7 @@
- long ret;
- long save_ssp;
-
- - if(Ssystem(-1, NULL, NULL)) {
- + if(__has_no_ssystem) {
- save_ssp = (long) Super((void *) 0L);
- /* note: dont remove volatile, otherwise gcc will reorder these
- statements and we get bombs */
- @@ -19,7 +21,7 @@
- return ret;
- }
- else
- - return Ssystem(GET_LVAL, var, NULL);
- + return Ssystem(S_GETLVAL, var, NULL);
- }
-
- void
- @@ -29,11 +31,11 @@
- {
- long save_ssp;
-
- - if(Ssystem(-1, NULL, NULL)) {
- + if(__has_no_ssystem) {
- save_ssp = (long) Super((void *) 0L);
- *((volatile long *)var) = val;
- (void)Super((void *) save_ssp);
- }
- else
- - (void)Ssystem(SET_LVAL, var, val); /* note: root only! */
- + (void)Ssystem(S_SETLVAL, var, val); /* note: root only! */
- }
- diff -ur orig/src/time.c ./src/time.c
- --- orig/src/time.c Fri May 29 19:00:00 1998
- +++ ./src/time.c Sun Aug 1 12:06:58 1999
- @@ -12,6 +12,7 @@
-
- #include <time.h>
- #include <mintbind.h>
- +#include <sys/cookie.h>
- #include "lib.h"
-
-
- @@ -132,7 +133,7 @@
- time_t made; struct timeval tv;
-
- if(CLOCK_cookie == -1)
- - Getcookie(0x434c4f4bL, &CLOCK_cookie); /* 'CLOK' */
- + Getcookie(C_CLOK, &CLOCK_cookie);
-
- if(CLOCK_cookie & OS_HAS_TgetTOD) {
- Tgettimeofday(&tv, NULL);
- diff -ur orig/src/timeoday.c ./src/timeoday.c
- --- orig/src/timeoday.c Fri Jun 5 03:25:06 1998
- +++ ./src/timeoday.c Sun Aug 1 12:29:30 1999
- @@ -20,13 +20,10 @@
- #include <types.h>
- #include <time.h>
- #include <unistd.h>
- -#ifdef __TURBOC__
- -#include <sys\timeb.h>
- -#else
- #include <sys/timeb.h>
- -#endif
- #include <mintbind.h>
- -#include <ssystem.h>
- +#include <mint/ssystem.h>
- +#include <sys/cookie.h>
-
- #ifdef HAS_BSD_TIME
- extern time_t timezone; /* in localtime.c */
- @@ -40,6 +37,8 @@
-
- int _t_o_day_first = 1; /* changed by stime(),settimeofday(), if successfull */
-
- +extern int __has_no_ssystem; /* main.c*/
- +
- static struct timeval the_time;
- static clock_t oticks;
-
- @@ -51,17 +50,13 @@
- return now;
- }
-
- -#ifdef HAS_SSYSTEM
- clock_t getticks(void)
- {
- - if (Ssystem(-1, NULL, NULL))
- + if (__has_no_ssystem)
- return (clock_t)Supexec(getnow);
- else
- - return (clock_t)Ssystem(GET_LVAL, 0x000004baL, NULL);
- + return (clock_t)Ssystem(S_GETLVAL, 0x000004baL, NULL);
- }
- -#else
- -#define getticks() (clock_t)Supexec(getnow)
- -#endif
-
- static void
- tvadd (struct timeval *tv1, struct timeval *tv2)
- @@ -85,7 +80,7 @@
- clock_t diff, ticks;
- long clockcookie;
-
- - Getcookie(0x434c4f4bL, &clockcookie); /* 'CLOK' */
- + Getcookie(C_CLOK, &clockcookie);
- if(!(clockcookie & (16L<<24))) { /* OS_HAS_TgetTOD */
- ticks = getticks(); /* DON'T replace by Supexec(getnow) ! */
-
- diff -ur orig/src/uname.c ./src/uname.c
- --- orig/src/uname.c Fri May 29 19:00:14 1998
- +++ ./src/uname.c Sun Aug 1 14:43:16 1999
- @@ -13,57 +13,34 @@
- #include <osbind.h>
- #include <stdio.h>
- #include <string.h>
- -#include <ssystem.h>
- +#include <mint/ssystem.h>
- #include <mintbind.h>
- -#ifdef __TURBOC__
- -#include <sys\utsname.h>
- -#else
- #include <sys/utsname.h>
- -#endif
- +#include <sys/cookie.h>
- +#include <sysvars.h>
-
- extern int __mint;
- +extern int __has_no_ssystem;
- +
- __EXTERN int gethostname __PROTO((char *buf, size_t len));
-
- static long _mch; /* value of the _MCH cookie, if any */
- -static int tosvers; /* TOS version number */
- +static int tosvers = 0; /* TOS version number */
-
- /*
- * get operating system information; must execute in supervisor mode
- */
-
- static long getinfo __PROTO((void));
- -static int no_ssystem;
-
- static long
- getinfo()
- {
- - long *cookie, *sysbase;
- -
- -/* get _MCH cookie value */
- - if(no_ssystem) {
- - cookie = *((long **) 0x5a0L);
- - if (cookie) {
- - while (*cookie) {
- - if (*cookie == 0x5f4d4348L) { /* _MCH */
- - _mch = cookie[1];
- - break;
- - }
- - cookie += 2;
- - }
- -
- - }
- -
- - }
- - else
- - _mch = Ssystem(GETCOOKIE, 0x5f4d4348L, NULL);
- + long *sysbase;
-
- /* get TOS version number */
- - if (no_ssystem) {
- - sysbase = *((long **)(0x4f2L));
- - tosvers = (int)(sysbase[0] & 0x0000ffff);
- - }
- - else
- - tosvers = (int)(Ssystem(TOSHEADER, 0L, NULL)&0x0000ffff);
- + sysbase = *((long **)(0x4f2L));
- + tosvers = (int)(sysbase[0] & 0x0000ffff);
-
- return 0;
- }
- @@ -74,13 +51,15 @@
- uname(buf)
- struct utsname *buf;
- {
- - no_ssystem = Ssystem(-1, NULL, NULL);
- - if (no_ssystem) {
- - if (!tosvers)
- + if (!tosvers)
- + {
- + if (__has_no_ssystem)
- (void)Supexec(getinfo);
- + else
- + tosvers = (int)(Ssystem(S_OSHEADER, 0L, NULL) & 0x0000ffff);
- }
- - else
- - getinfo();
- +
- + Getcookie(C__MCH, &_mch);
-
- strcpy(buf->sysname, __mint ? "MiNT" : "TOS");
-
-